!
function(e) {
    var t = function() {
        var e = this;
        $().ready(function() {
            e.init(),
            e.eventReg(),
            e.search(1, getDefaultPageSize())
        })
    };
    t.prototype = {
        init: function() {
            get("/staffleveling/listall", null,
            function(e) {
                if (e.success) {
                    var t = e.data;
                    t.splice(0, 0, {
                        ID: 0,
                        RealName: "不限"
                    }),
                    $("#levelingStaff").combobox({
                        data: t
                    })
                }
            })
        },
        eventReg: function() {
            var e = this;
            $("#dateRange").daterangepicker({
                autoApply: !0,
                startDate: $("#startDate").val(),
                endDate: $("#endDate").val()
            },
            function(e, t, a) {}),
            template.helper("formatTime",
            function(e) {
                return e.toDateString()
            }),
            $("#btnSearch").on("click",
            function() {
            	$('.search').submit();
                //e.search(1, getDefaultPageSize())
            }),
            $("#btnGenBill").button({
                onClick: function() {
                    var t = $("#dateRange").val().split("-"),
                    a = {
                        StartDate: t[0],
                        EndDate: t[1],
                        StaffLevelingID: $("#levelingStaff").combobox("getValue"),
                        OrderNo: $("#orderNo").textbox("getText")
                    };
                    post("/order/bill", JSON.stringify(a),
                    function(t) {
                        t.success && (message("生成成功"), e.search(1, getDefaultPageSize()))
                    })
                }
            })
        },
        search: function(e, t) {
            var a = this,
            n = $("#dateRange").val().split("-"),
            r = {
                startDate: n[0],
                endDate: n[1],
                levelingStaffID: $("#levelingStaff").combobox("getValue"),
                orderNo: $("#orderNo").textbox("getText"),
                pageIndex: e,
                pageSize: t
            };
            get("/index/index/completeData", r,
            function(e) {
                if (e.success) {
                    var n = template("temp", e.data),
                    r = e.data.Pager;
                    $("#orders").html(n),
                    $("#pager").pager({
                        pageIndex: 1,
                        pageCount: r.PageCount,
                        pageSize: r.PageSize,
                        recordCount: r.Total,
                        pageIndexChange: function(e) {
                            a.query(e, t)
                        },
                        pageSizeChange: function(e) {
                            a.search(1, e)
                        }
                    })
                } else message(e.errorMsg)
            })
        },
        query: function(e, t) {
            var a = $("#dateRange").val().split("-"),
            n = {
                startDate: a[0],
                endDate: a[1],
                levelingStaffID: $("#levelingStaff").combobox("getValue"),
                pageIndex: e,
                pageSize: t
            };
            get("/order/BillingData", n,
            function(e) {
                if (e.success) {
                    var t = template("temp", e.data);
                    $("#orders").html(t)
                } else message(e.errorMsg)
            })
        }
    },
    e.OrderSettlement = new t
} (window);